package com.shuyun.spring4.showcase.quickstart2;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by goodb on 2017/1/3.
 */
@Configuration
public class JavaConfig {

    @Bean
    public FunctionService2 functionService2(){
        return new FunctionService2();
    }

    @Bean
    public UseFunctionService2 useFunction2(){
        UseFunctionService2 useFunction2 = new UseFunctionService2();
        useFunction2.setFunctionService2(functionService2());
        return useFunction2;
    }

//    @Bean
//    public UseFunctionService2 useFunctionService2(FunctionService2 functionService2){
//        UseFunctionService2 useFunctionService2 = new UseFunctionService2();
//        useFunctionService2.setFunctionService2(functionService2);
//        return useFunctionService2;
//    }

}
